package 智能家电;

import java.util.*;

public class Household {
    private boolean on = false;
    private String brand;
    private Date productDate;
    public  Household(String brand,Date productDate){
        this.brand = brand;
        this.productDate = productDate;
    }
    public boolean isOn(){
        return this.on;
    }
    public void setOn(boolean on){
        this.on = on;
    }
    public String getBrand(){
        return this.brand;
    }
    public Date getproductDate(){
        return this.productDate;
    }


    public String getProductDateString(){
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(productDate);
        String k = calendar.get(Calendar.YEAR)+"-"+(calendar.get(Calendar.MONTH) + 1)+"-"+calendar.get(Calendar.DAY_OF_MONTH);
        return k;
    }
}
